randomAttr = {}
---基础属性
randomAttr.t = {
    {"life", "生命", 0},
    {"mana", "魔法", 0},
    {"move", "移动", 0},
    {"defend", "护甲", 0},
    {"defend_white", "基础护甲", 0},
    {"defend_green", "附加护甲", 0},
    {"attack_speed", "攻速", 0},
    {"attack_space", "攻击间隔", 0},
    {"attack_space_origin", "攻击间隔", 0},
    {"attack", "攻击", 0},
    {"attack_white", "基础攻击", 0},
    {"attack_green", "附加攻击", 0},
    {"attack_range", "攻击范围", 0},
    {"attack_range_acquire", "主动攻击范围", 0},
    {"sight", "视野范围", 0},
    {"str", "力量", 0},
    {"agi", "敏捷", 0},
    {"int", "智力", 0},
    {"str_green", "附加力量", 0},
    {"agi_green", "附加敏捷", 0},
    {"int_green", "附加智力", 0},
    {"str_white", "本体力量", 0},
    {"agi_white", "本体敏捷", 0},
    {"int_white", "本体智力", 0},
    {"life_back", "生命恢复", 0},
    {"mana_back", "魔法恢复", 0},
    {"avoid", "回避", 0},
    {"aim", "命中", 0},
    {"punish", "僵直", 0},
    {"punish_current", "当前僵直", 0},
    {"hemophagia", "吸血", 0}, --(%)
    {"hemophagia_skill", "技能吸血", 0}, --(%)
    {"siphon", "吸魔", 0}, --(%)
    {"siphon_skill", "技能吸魔", 0}, --(%)
    {"invincible", "无敌", 0}, --(%)
    {"weight", "负重", 0},
    {"weight_current", "当前负重", 0},
    {"damage_extent", "伤害增幅", 0}, --(%)
    {"damage_reduction", "减伤", 0}, --(固定)
    {"damage_decrease", "减伤", 0}, --(%)
    {"damage_rebound", "反弹伤害", 0}, --(%)
    {"damage_rebound_oppose", "反伤抵抗", 0},
    {"cure", "治疗", 0}, --(%)
    {"reborn", "复活时间", -999},
    {"knocking_odds", "暴击几率", 0},
    {"knocking_extent", "暴击增伤", 0}, --(%)
    {"knocking_oppose", "暴击抵抗", 0},
    {"hemophagia_oppose", "吸血抵抗", 0},
    {"hemophagia_skill_oppose", "技能吸血抵抗", 0},
    {"siphon_oppose", "吸魔抵抗", 0},
    {"siphon_skill_oppose", "技能吸魔抵抗", 0},
    {"buff_oppose", "强化阻碍", 0},
    {"debuff_oppose", "负面抵抗", 0},
    {"split_oppose", "分裂抵抗", 0},
    {"punish_oppose", "僵直抵抗", 0},
    {"swim_oppose", "眩晕抵抗", 0},
    {"broken_oppose", "打断抵抗", 0},
    {"silent_oppose", "沉默抵抗", 0},
    {"unarm_oppose", "缴械抵抗", 0},
    {"fetter_oppose", "定身抵抗", 0},
    {"bomb_oppose", "爆破抵抗", 0},
    {"lightning_chain_oppose", "闪电链抵抗", 0},
    {"crack_fly_oppose", "击飞抵抗", 0}
}
---附魔
randomAttr.f = {
    
}
---随机符号
randomAttr.a = {"+", "-"}
---随机最大值
randomAttr.c = 100

---随机attr字符串
function randomAttr:attr()
    local count = #randomAttr.t
    local index = randomAttr:int(count)
    local str = randomAttr.t[index][1]

    return str
end

---随机整数
function randomAttr:int(count)
    return  math.random(1,count)
end

---随机值
function randomAttr:value()
    ---local fuhao = randomAttr.a[randomAttr:int(#randomAttr.a)]
    return "+" .. randomAttr:int(randomAttr.c)
end

---从所有属性中随机
function randomAttr:randomAllAttr()
    local data={}
    data[self:attr()]=self:value()
    return data
end
